package com.k.demo.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.k.demo.entity.ShoppingCart;

@Mapper
public interface ShoppingCartMapper {
	//根据用户ID查询购物车
	ShoppingCart selectCartByUserID(int userID);
	
	//根据购物车ID查询购物车
	ShoppingCart selectCartByCartID(int cartuserID);
	
	//插入购物车需要用户id
	@Insert("insert into shopping_cart values(shopping_cart_id_seq.nextval,#{value},default)")
	int insertShoppingCart(int userID);
	
	//简单的根据用户id查询购物车信息
	@Select("select * from shopping_cart where user_id=#{value} and is_delete=1")
	ShoppingCart simpleSelectByUserID(int userID);
}
